import { JJBasePresenter } from './../../../mobileClientKernel/bizUtil/index.js'
import JJHomepageService from './../../../service/homepageService/JJHomepageService.js'

export default class JJHomepagePresenter extends JJBasePresenter {

    homepageData = {
        motto: 'Hello World'
    }

    requestWeather(networkSuccessCallBack, networkFailCallBack) {
        const me = this
        JJHomepageService.requestGetWeather(function (isSuccess, value, otherInfo) {
            me.homepageData.motto = value.errMsg
            networkSuccessCallBack(isSuccess, value, otherInfo)
        }, function (error, otherInfo) {
            me.homepageData.motto = value.errMsg
            networkFailCallBack(error, otherInfo)
        })
    }
}
